package com.atguigu.flink.chapter5.transform;

import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @Author lizhenchao@atguigu.cn
 * @Date 2020/12/19 14:56
 */
public class Flink07_Transform_Split {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(2);
        /*DataStreamSource<Integer> source = env.fromElements(10, 2, 3, 40, 5);
        SplitStream<Integer> splitStream = source.split(new OutputSelector<Integer>() {
            @Override
            public Iterable<String> select(Integer value) {
                if (value % 2 == 0) {
                    return Collections.singletonList("偶数");
                } else {
                    return Collections.singletonList("奇数");
                }

            }
        });
        splitStream
          .select("奇数")
          .print();*/


        env.execute();
    }
}
/*
这些function 都有一个Rich
 */
